<?php
header('Access-Control-Allow-Origin:*');
$nickname = $_POST['nickname'];
// var_dump($nickname);exit;
if(!isset($nickanme)){
    $uid = uniqid().mt_rand(0,99999);
    $data = ['nickname' => $nickname , 'uid' => $uid];
    echo json_encode(array(
        'code' => 1,
        'data' => $data,
    ));
}else{
    echo json_encode(array(
        'code' => 0,
        'data' => ['msg' => '参数错误'],
    ));
}